package io;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

public class TestNote {
    public static void main(String[] args) throws IOException {
        Scanner scan=new Scanner(System.in);
        File file=new File("note.txt");
        FileOutputStream fos=new FileOutputStream(file);
        while (true){
            System.out.println("请输入,输入exit时退出：");
            String num=scan.nextLine();
            fos.write(num.getBytes(StandardCharsets.UTF_8));

            if ("exit".equals(num)){
                System.out.println("输入结束！");
                break;
            }

        }
        fos.close();
    }
}
